<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改【请填写功能名称】')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-ordertable-edit" th:object="${ordertable}">
            <input name="idOrder" th:field="*{idOrder}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">选择商品：</label>
                <select class="btn btn-default dropdown-toggle is-required" name="productIDOrder" th:with="type=${@product.queryProductList()}">
                    <option th:text="*{pName}" th:value="*{productIDOrder}">--请选择商品--</option>
                    <option th:each="product : ${type}" th:text="${product.nameProduct}" th:value="${product.idProduct}"></option>
                </select>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">商品单价：</label>
                <div class="col-sm-8">
                    <input name="priceOrder" th:field="*{priceOrder}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">男方数量：</label>
                <div class="col-sm-8">
                    <input name="manCount" th:field="*{manCount}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">女方数量：</label>
                <div class="col-sm-8">
                    <input name="grilCount" th:field="*{grilCount}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">商品总数：</label>
                <div class="col-sm-8">
                    <input name="countOrder" th:field="*{countOrder}" class="form-control" type="text" required>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/ordertable";
        $("#form-ordertable-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-ordertable-edit').serialize());
            }
        }
    </script>
</body>
</html>